import QtQuick
import Qt5Compat.GraphicalEffects
import Fk
import Fk.Components.GameCommon as Game

Game.BasicItem {
  id: root

  property int pieceId
  property string name
  property int xPos
  property int yPos

  selectable: true

  width: 50
  height: 50

  Image {
    id: img
    source: `${Cpp.path}/packages/chess-games/image/xiangqi/${pieceId < 0 ? "black" : "red"}_${name}.svg`
    sourceSize: Qt.size(200, 200)
    width: 54; height: 54
    anchors.centerIn: parent
    // visible: false
  }

  /*
  ColorOverlay {
    anchors.fill: img
    source: img
    color: root.selectable ? "transparent" : "#5A000000"
  }
  */

  Image {
    source: Cpp.path + "/packages/chess-games/image/xiangqi/marker.svg"
    visible: root.selected
    anchors.fill: parent
  }
}
